package com.oasystem.enums;

public enum EPermissionType {
	NORMAL("N", "普通用户"), ACCOUNTING("A", "会计"), LEADER("L", "领导"), SYSTEM("S",
			"管理员"), NA(null, null);
	;

	private String code;
	private String description;

	private EPermissionType(String code, String description) {
		this.code = code;
		this.description = description;
	}

	public static EPermissionType getByCode(String code) {
		if ("N".equals(code)) {
			return EPermissionType.NORMAL;
		} else if ("L".equals(code)) {
			return EPermissionType.LEADER;
		} else if ("A".equals(code)) {
			return EPermissionType.ACCOUNTING;
		} else if ("S".equals(code)) {
			return EPermissionType.SYSTEM;
		} else {
			return EPermissionType.NA;
		}
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

}
